package com.hbsoft.sub;


import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;

import javax.swing.JTextField;

import com.hbsoft.com.JAutoCompleteComboBox;

public class LinePanelAction {

	private LinePanel line = null;
	private AddLinePanel addLine = null;
	private JAutoCompleteComboBox jccb1 = null;
	private JAutoCompleteComboBox jccb2 = null;
	private JAutoCompleteComboBox jccb3 = null;
	private JAutoCompleteComboBox jccb4 = null;
	private JTextField jf1 = null;
	private JTextField jf2 = null;
	private JTextField jf3 = null;
	private JTextField jf4 = null;
	
	public LinePanelAction(LinePanel line)
	{
		this.line = line;
		jccb1 = line.getJccb1();
		jccb2 = line.getJccb2();
		jccb3 = line.getJccb3();
		jccb4 = line.getJccb4();

		jf1 = line.getJf1();
		jf2 = line.getJf2();
		jf3 = line.getJf3();
		
		addAction();
	}
	
	private void addAction()
	{
		
		jf1.addFocusListener(new FocusListener(){
			public void focusGained(FocusEvent arg0) {
				jf1.setEditable(true);
			}
			
			public void focusLost(FocusEvent arg0) {
				jf1.setEditable(false);
			}
		});
		
		jf2.addFocusListener(new FocusListener(){
			public void focusGained(FocusEvent arg0) {
				jf2.setEditable(true);
				jf3.setText("kkkk");
			}
			
			public void focusLost(FocusEvent arg0) {
				jf2.setEditable(false);
				
			}
		});
		
		
	}
	

	
}
